package com.example.card.transactionimplementation;

import com.example.card.CardDataBase;
import com.example.card.Transaction;
import com.example.card.domain.user.User;

public class AddUserTransaction implements Transaction {

    private final int id;
    private final String name;
    private final String phone;

    public AddUserTransaction(int id, String name, String phone) {
        this.id = id;
        this.name = name;
        this.phone = phone;
    }

    @Override
    public void execute() {
        User user = new User(id, name, phone);
        CardDataBase.addUser(user);
    }
}
